home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2005 May / CyberMycha 05-2005 (Poland).bin / Immortal / cotndemo.exe / Data1.cab / transport.tai < prev    next >
Encoding:
Text File  |  2004-11-16  |  2.1 KB  |  92 lines

  1. //
  2. //    Transport AI file
  3. //
  4. //    Behaviors:
  5. //
  6. //        Path to passengers.  Let them load.  Path to unload point.  Unload passengers
  7. //
  8. //    Notes:
  9. //        This overloads a few of the generic movement actions
  10. //
  11. //    Known Problems:
  12. //
  13. //    Usage:
  14. //
  15. //        To tell a unit to move to a location, give it a load/unload transport goal (EEUGLoad/UnloadTransport)
  16. //            and set its action to keeuaPrepareToMove.
  17. //
  18.  
  19. #include("Generic Death.tai")
  20.  
  21. #include("Load Container.tai")
  22.  
  23. // Override these two transitions to inhibit pursuit
  24. FaceEnemyUnit
  25. {
  26.     UnitInWeaponRange false(Idle)
  27. }
  28. AttackEnemyUnit
  29. {
  30.     UnitInWeaponRange false(Idle)
  31. }
  32.  
  33. // is pathfinding complete?
  34. PrepareToMove
  35. {
  36.     allof(GoalIsUnloadTransport,ContainerInRange) true(UnloadTransport)
  37.     NoMoreWaypoints true(TurnToUnitFacing)
  38.     MovePreparationComplete true(Advance)
  39. }
  40.  
  41. RepathAroundObstacle
  42. {
  43.     MovePreparationComplete true(Advance) false(Idle)
  44. }
  45.  
  46. // are we at a waypoint?
  47. Advance
  48. {
  49.     NoMoreLoadableUnitsToPickUp true(TurnToUnitFacing)
  50.     ArrivedAtMoveWaypoint true(GetNextMoveWaypoint)
  51.     ObstacleDetected true(RepathAroundObstacle)
  52. }
  53.  
  54. // gets the next location
  55. GetNextAutoWaypoint
  56. {
  57.     UnitHasGoal true(PrepareToMove) false(Idle)
  58. }
  59.  
  60. // we've reached the end of the path
  61. ReacquireGoal
  62. {
  63.     GoalIsLocation true(Idle)
  64.     GoalIsExplore  true(FindUnexploredArea)
  65.     allof(GoalIsUnloadTransport,ContainerInRange) true(UnloadTransport) 
  66.     allof(GoalIsUnloadTransport,CanIMove) true(PrepareToMove) false(Idle)
  67. }
  68.  
  69. // look for new waypoints and detect the end of the path - order matters
  70. GetNextMoveWaypoint
  71. {
  72.     allof(GoalIsUnloadTransport,ContainerInRange) true(UnloadTransport)
  73.     allof(GoalIsLoadContainer,NextWaypointRetrieved) true(PickedUpLoadableUnits) 
  74.     ShouldMoveToNextAutoWaypoint true(GetNextAutoWaypoint)
  75.     NextWaypointRetrieved true(Advance)    
  76.     NoMoreWaypoints true(TurnToUnitFacing) false(TurnToUnitFacing)
  77. }
  78.  
  79. FindUnexploredArea
  80. {
  81.     SearchingForAreaToExplore true(FindUnexploredArea)
  82.     NoUnexploredAreasLeft true(Idle) false(PrepareToMove)
  83. }
  84.  
  85. UnloadTransport
  86. {
  87.     GoalIsUnloadTransport true(Idle)    
  88. }
  89.  
  90.  
  91.  
  92.